package com.qidian.mes.cal.controller;

import com.qidian.mes.cal.service.CalTeamShiftService;
import com.qidian.mes.cal.vo.TeamAndShiftVO;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@CrossOrigin
@RequestMapping("/teamShift")
public class CalTeamShiftController {
    @Autowired
    CalTeamShiftService calTeamShiftService;

    @GetMapping("/select")
    //分类排版日历
    public MESResult select() {
        return calTeamShiftService.select();
    }

    @PostMapping("/save")
    //添加班组排班
    public MESResult save(@RequestBody TeamAndShiftVO vo) {
        return calTeamShiftService.save(vo);
    }

    @GetMapping("/list")
    //查询班组信息
    public MESResult list(Long planId) {
        return calTeamShiftService.list(planId);
    }

    @DeleteMapping("/delete")
    //删除排班
    public MESResult delete(Long recordId) {
        return calTeamShiftService.delete(recordId);
    }
}
